/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package UserInterface;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;


/**
 *
 * @author Julien
 */
public class GUIGestionProfils  extends GUI{

    private JPanel panBoutons = new JPanel();
    private JLabel titre = new JLabel("Gestion des profils");
    private JButton ajouter = new JButton("Ajouter");
    private JButton Visualisermodifier = new JButton("Visualiser/modifier");
    private JButton Supprimer = new JButton("Supprimer");

    public GUIGestionProfils()
    {
        super();
        System.out.println("TEST profil");
        ajouter.addActionListener(this);

        this.conteneurComplement.setLayout(new BorderLayout());
        this.titre.setFont(new java.awt.Font("Tahoma", 0, 21));
        this.conteneurComplement.add(titre,BorderLayout.NORTH);
        this.conteneurComplement.add(panBoutons,BorderLayout.CENTER);
        this.titre.setForeground(new java.awt.Color(0, 153, 153));
        this.titre.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        this.panBoutons.setPreferredSize(new Dimension(50,0));
        this.panBoutons.setLayout(new GridBagLayout());
         GridBagConstraints c = new GridBagConstraints();
           c.anchor = GridBagConstraints.CENTER;
           c.insets = new Insets(0, 0, 0, 0);

           c.gridx = 0;
           c.gridy = 0;
           c.gridwidth = 1;
           c.gridheight = 1;
           c.weightx = 1;
           c.weighty = 1;

           this.panBoutons.add(this.ajouter,c);
           //this.ajouter.addActionListener(this);
           this.ajouter.setActionCommand("ajouter");
 
           c.gridx = 0;
           c.gridy = 1;


           this.panBoutons.add(this.Visualisermodifier,c);
           this.Visualisermodifier.addActionListener(this);
           this.Visualisermodifier.setActionCommand("Visualiser/modifier");
  

           c.gridx = 0;
           c.gridy = 2;

           this.panBoutons.add(this.Supprimer,c);
           this.Supprimer.addActionListener(this);
           this.Supprimer.setActionCommand("Supprimer");
        //  this.conteneurComplement.add(this.tableEcole,BorderLayout.WEST);
        //this.tableEcole.setPreferredSize(new Dimension(150,150));
      //   this.conteneurComplement.add(this.panTableau,BorderLayout.NORTH);
       // this.north.add(this.titre,BorderLayout.NORTH);

          this.fenetre.pack();
    }

     public void actionPerformed(ActionEvent e) {
       //redirection lors de la connexion
       if (e.getSource()==ajouter) {


                 System.out.println("ESSAI 1");
                //GUIGestionPromos pagesuivante = new GUIGestionPromos();
                 //GUIGestionProfils pagesuivante = new GUIGestionProfils();
                GUIVisualisationProfils pagesuivant = new GUIVisualisationProfils();
               System.out.println("ESSAI 3");
               this.fenetre.dispose();

       }
      // else if (e.getSource()==ajouter)

    }


}
